Skip to content

Upgrade async-profiler to 3.0 - #248

Merged
JonasKunz merged 17 commits into
elastic:mainfrom
JonasKunz:async-profiler-3-upgrade
May 14, 2024
Merged

Upgrade async-profiler to 3.0#248
JonasKunz merged 17 commits into
elastic:mainfrom
JonasKunz:async-profiler-3-upgrade

Conversation

@JonasKunz

@JonasKunz JonasKunz commented May 7, 2024

Copy link
Copy Markdown
Contributor

Closes #173 .

@JonasKunz
JonasKunz marked this pull request as ready for review May 8, 2024 08:57
@JonasKunz
JonasKunz requested a review from a team May 8, 2024 08:57
@JonasKunz

Copy link
Copy Markdown
Contributor Author

I've also done manual testing using the elastiflix app and can confirm that inferred spans are still functional.

@SylvainJuge SylvainJuge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work ! As usual I only have minor comments and questions.

JfrParser jfrParser = new JfrParser(ByteBuffer.allocate(113), ByteBuffer.allocate(113));
// Using a small buffer, but big enough to fit the largest string in the JFR file to test edge
// cases
JfrParser jfrParser = new JfrParser(ByteBuffer.allocate(368), ByteBuffer.allocate(368));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] where does this magic value comes from ? how to pick an appropriate value and maintain this in the future ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just a small value to trigger the edge cases in BufferdFile, like before.
In the new JFR-file the longest string was 368 characters, which therefore is the lower bound to not crash the parsing.

Comment on lines 111 to +112
throw new IllegalStateException(
"Unexpected sampling profiler error, everything else should work as expected. "
+ "Please report to us with as many details, including OS and JVM details.");
"This implementation does not support reading JFR files containing multiple chunks");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] does it means we could make it work (probably more efficiently) with >1 chunk per file in the future ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async-profiler in the way we use it generates JFR files consisting only of a single chunk. Splitting those files into smaller chunks wouldn't make it more efficient to use, because then you'd end up with more duplications (e.g. duplicate stack traces).

JonasKunz and others added 2 commits May 14, 2024 15:03
…filer/JfrParser.java

Co-authored-by: SylvainJuge <763082+SylvainJuge@users.noreply.github.com>
@JonasKunz
JonasKunz merged commit abb424a into elastic:main May 14, 2024
@JonasKunz
JonasKunz deleted the async-profiler-3-upgrade branch May 14, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Inferred spans to async-profiler 3.x

2 participants